import { defineStore } from 'pinia';

export const useLogisticsStore = defineStore('logistics', {
  state: () => ({
    logisticsData: [
      { time: '2023-10-01 10:00', status: '包裹已出库' },
      { time: '2023-10-02 12:00', status: '包裹已到达中转站' },
      { time: '2023-10-03 15:00', status: '包裹正在派送' },
      { time: '2023-10-04 18:00', status: '包裹已签收' },
    ],
  }),
  getters: {
    activeStep: (state) => state.logisticsData.length - 1,
  },
  actions: {
    updateLogisticsData(newData) {
      this.logisticsData = newData;
    },
  },
});
